package exception;

import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class FinallyDemo2 {
    public static void main(String[] args) {




        System.out.println("程序开始：");
        FileOutputStream fos = null;
        try {

            fos=new FileOutputStream("./a/c/c/ttttt.txt");
            fos.write("在附近".getBytes(StandardCharsets.UTF_8));
        }catch (IOException e){
            System.out.println("空指针异常");

        }finally {
            try {
                fos.close();
            } catch (Exception e) {
                System.out.println("去拉萨吧，那里没有关闭流");
            }
        }

        System.out.println("程序结束。");

    }
}
